package com.treasure.mall.biz.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.treasure.mall.zbq.common.constant.Constant;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.time.LocalDateTime;

/**
 * @author allan
 * @date 2019-08-19
 */
@Setter
@Getter
@EntityListeners(AuditingEntityListener.class)
@MappedSuperclass
public class Base2PO {
    /**
     * 创建时间
     */
    @Column(name = "create_time", columnDefinition = Constant.DATE_COLUMN_DEFINITION)
    @CreatedDate
    private LocalDateTime createTime;
    /**
     * 修改时间
     */
    @Column(name = "update_time", columnDefinition = Constant.DATE_COLUMN_DEFINITION)
    @LastModifiedDate
    private LocalDateTime updateTime;
    /**
     * 创建者
     */
    private String creator;
}
